<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="p30">
				<image :src="path" mode="widthFix" class="img"></image>
				<l-painter isCanvasToTempFilePath @success="path = $event" hidden
					css="width: 690rpx;height:1144rpx;position: relative;border-radius: 20rpx;">
					<l-painter-image src="/static/public/img_post-bg.png"
						css="width: 690rpx;height: 1144rpx;border-radius: 20rpx;position: absolute;top:0;left:0;z-index:1;" />
					<l-painter-view
						css="left:30rpx;top:899rpx;width:630rpx;height:215rpx;border-radius: 20rpx;position: absolute;z-index:2;background:#fff;"></l-painter-view>
					<l-painter-image :src="picData[1]"
						css="left:53rpx;top:957rpx;width: 100rpx;height: 100rpx;border-radius: 50rpx;position: absolute;z-index:3;" />

					<l-painter-view css="left:172rpx;top:970rpx;width: 300rpx;position: absolute;z-index:4;">
						<l-painter-text :text="data.text1"
							css="display: block;color: #000; font-size: 32rpx;line-height: 36rpx;line-clamp: 1;" />
					</l-painter-view>
					<l-painter-view css="left:172rpx;top:1020rpx;width: 300rpx;position: absolute;z-index:5;">
						<l-painter-text text="长按二维码，立即加入"
							css="display: block;color: #737373; font-size: 28rpx;line-height: 36rpx;line-clamp: 1;" />
					</l-painter-view>
					<l-painter-image :src="picData[0]"
						css="left:470rpx;top:920rpx;width: 176rpx;height: 176rpx;border-radius: 50%;position: absolute;z-index:6;" />

				</l-painter>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				path: '',
				picData: [],
				picTemp: [],
				imgInfo: {},
				data: ''
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad() {
			
			let that = this;
			let data = that.$core.getCache('temp');
			this.data=data
			if (data) {
				that.picData = [
					data.img2, // 二维码
					data.img1 || 'https://xilu-images.oss-cn-shanghai.aliyuncs.com/assets/img/avatar.png' //头像||logo
				]

				uni.getImageInfo({
					src: that.picData[1],
					success(res) {
						that.imgInfo= res
					}
				})
			}
		},
		methods: {
			  
			onShareAppMessage() {
				let userinfo = app.getUserinfo();
				let path = '/pages/public/index';
				if (userinfo) {
					path = '/pages/public/index?uid=' + userinfo.id + '&group=' + userinfo.group_id;
				}
				return {
					title: '邀请好友',
					path: path,
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.img{
		width: 690rpx;
		margin-left: auto;
		margin-right: auto;
	}
	.m_btn1 {
		margin: 0;
		padding: 0;
		width: 330rpx;
		height: 90rpx;
		background: var(--primary);
		border-radius: 15rpx;
		font-size: 30rpx;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
	}

	.m_btn1::after {
		content: none;
	}

	.m_btn2 {
		width: 330rpx;
		height: 90rpx;
		background: var(--primary);
		border-radius: 15rpx;
		font-size: 30rpx;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
	}
</style>